<?php

namespace App\Models;


use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class GoodsLog extends Model
{
    use HasFactory;
    protected $table = "sp_goods_log";
    protected $primaryKey = 'id';
    public $timestamps = false;

    protected function AddGoodsLog($admin_id,$goods_id,$setmeal_id,$operation_explain,$update_data)
    {
        $data = [];
        $data['admin_id'] = $admin_id;
        $data['goods_id'] = $goods_id;
        $data['setmeal_id'] = $setmeal_id;
        $data['operation_explain'] = $operation_explain;
        $data['update_data'] = $update_data;
        $data['user_agent'] =  $_SERVER['HTTP_USER_AGENT'];
        $data['user_ip'] = getRealIp();
        $data['create_time'] = date('Y-m-d H:i:s');
        $this->insert($data);
    }

}
